<template>
  <div @click="handleDetail(item.id)">
    <img :src="item.coverImgUrl" alt="" />
    <p>{{ item.name }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    item: {
      type: Object,
    },
  },
  mounted() {},
  methods: {
    handleDetail(id) {
      this.$router.push(`/musicDetail/${id}`);
    },
  },
};
</script>

<style scoped>
div {
  padding: 15px;
}
img {
  width: 2.9333rem;
  height: 2.9333rem;
}
p {
  width: 220px;
  overflow: hidden;
  text-align: left;
  line-height: 0.6667rem;
  text-overflow: ellipsis;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  display: -webkit-box;
}
</style>